<!--js设置css样式-->
<html>
	<head>
		<meta charset="UTF-8">
		<title>js设置css样式</title>
		<style type="text/css">
			.test {
				background: pink;
			}
		</style>
	</head>
	<body>
		<div id="div1"><p>memda</p></div>
		<input type="text" id="inpt" value="123456"/>
	</body>
	<script type="text/javascript">
		var div= document.getElementById("div1");
		div.style.border="2px solid red";
		div.style.fontSize="30px";
		div.className="test";
		//div.innerHTML="<h1>heheheh</h1>"; //设置div内容
		div.innerText="<span>xxxxxxxxxx</span>";
		var inp = document.getElementById("inpt");
//		inp.disabled=true;
		console.log(inp);
		inp.readOnly='readonly';
		inp.maxLength=10;
	</script>
</html>